/*
 * @Description: 
 * @Author: 张凌瑞
 * @Date: 2021-02-26 11:11:45
 * @LastEditTime: 2021-02-27 07:29:20
 * @LastEditors: Zhang Zhaoda
 */

//引入axios
import instance from "@/utiles/instance"
//引入type
import {GETTYPEDATA,CHANGEKEY} from "../types/type.types"

//获取type页面数据
export function getTypeData(SerialID:string) {
  return (dispatch: any) => {
    instance.get(
      '/api/v2-car-getInfoAndListById.html',
      {
        params: {
          'SerialID': SerialID
        }
      }
    ).then(res => {
      if(res.data.msg=='成功'){
        
        dispatch({
          type:GETTYPEDATA,
          list:res.data.data.list
        })
      }
      
    })
  }
}
//改变key值
export function changeKey(key:string){
  return {
    type:CHANGEKEY,
    typeKey:key
  }
}